﻿using SqlSugar;
using static DataModels.Enums.GeneralEnum;

namespace DataModels.Entities.AuthCore
{
    /// <summary>
    /// 短信验证码记录表
    /// </summary>
    [SugarTable]
    public class SmsVerificationCode
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        public string PhoneNumber { get; set; }

        /// <summary>
        /// 验证码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 过期时间 5分钟
        /// </summary>
        public DateTime ExpireTime { get; set; } = DateTime.Now.AddDays(5);

        /// <summary>
        /// 是否已使用
        /// </summary>
        public Status IsUsed { get; set; }
    }
}